home *** CD-ROM | disk | FTP | other *** search
- /********************************************************************
- * *
- * Text help display routines for TEST program (text dialog) *
- * by Ken Hollis *
- * *
- * Copyright (c) Bitgate Software and Clever Bits 1994 *
- * All rights reserved. *
- * *
- * This is one of many methods that can be used to display text *
- * within dialogs. You can also use W_DIALOGICON | W_TEXT. *
- * *
- * This file uses an array of text, and displays it within the *
- * dialog's display work area. This is not an actual WinLIB PRO *
- * library routine. These are routines we created ourself. These *
- * will eventually be implemented into WinLIB PRO as Text Dialogs, *
- * but not yet. We will give more details as time goes by. *
- * *
- * Another nice feature we may add is Text Gadgets, as requested *
- * from many libraries, but no other libraries offer them. Maybe *
- * we should! *
- * *
- ********************************************************************/
-
- #include <stddef.h>
- #include <stdlib.h>
- #include "winlib.h"
- #include "test.h"
-
- static int lastpos, showable;
-
- char *texthelp[] =
- { "Welcome to WinLIB PRO version 0.64A. ",
- " ",
- "WinLIB PRO was conceived and designed ",
- "by the following remarkable people: ",
- " ",
- "Ken Hollis (khollis@bitsink.gbdata.com) ",
- "Karl 0ygard (karlo@ifi.uio.no) ",
- "Markus Gutschke (gutschk@uni-muenster.de) ",
- " ",
- "New additions since last release (1993): ",
- "\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\" ",
- "- Internal custom help window ",
- "- New 3D Menu bar and sizing fix routines ",
- "- Custom menubar handling routines ",
- "- Desktop routines with drag/drop protocol",
- "- Menu bars with side-rooted objects ",
- "- Dropdown and popup menu bar routines ",
- "- Redraw-as-you-drag sliders (ultra-fast) ",
- "- Multi-timer display (as many as wanted) ",
- "- Call accessories through custom menubars",
- "- Color icons with radio buttons ",
- "- ASCII-Table for editing (hit Insert) ",
- "- Redraw-as-you-drag modal dialog boxes ",
- "- Cookie management routines ",
- "- So much more ",
- " ",
- "What is WinLIB Pro? ",
- "\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\" ",
- "WinLIB PRO is an object-oriented library ",
- "for the Atari ST offering many features ",
- "that GEM didn't ever normally offer. This",
- "GUI (Graphical User Interface) offers many",
- "modifications to AES, and easier-to-use ",
- "and call functions for the AES and VDI. ",
- "There's not alot to tell about WinLIB PRO,",
- "except for the fact that it is a one-of-a-",
- "kind programming library. There is none ",
- "available for the Atari ST that is quite ",
- "like this. ",
- " ",
- "WinLIB PRO combines ideas from the follow-",
- "ing programming libraries (and adds its ",
- "own ideas as well): ",
- " ",
- "Enhanced GEM, Compact GEM, GEM++, ",
- "WindClass, Application Library (APP_LIB), ",
- "Windows 3.1, Windows 4.0 (Chicago), Motif,",
- "OpenLook, NeXTDesk, MultiTOS, Geneva, ",
- "InterFace (EXTOBFIX), Zoom! Color Icon ",
- "editor, XAES, XAES Pro, WAZ Text Library, ",
- "Window Extensions (WinX), Mag!x and ",
- "WXLIB. ",
- " ",
- "WinLIB PRO combines interface designs from",
- "InterFace, Zoom!, OpenLook, Motif, Geneva,",
- "MultiTOS, NeXT, WindDesk, Window 3.1, ",
- "OS/2, and MultiScope (Sun) ",
- " ",
- "WinLIB PRO offers the following features: ",
- "\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\" ",
- "- Our own OOP design ",
- "- Everything is windowed (object oriented)",
- "- Menubars can be inside windows ",
- "- Toolbox capability ",
- "- 5 different 3D drawing styles ",
- "- Hotkeys (three different styles) ",
- "- Background clickable windows (like MTOS)",
- "- Redraw-as-you-drag sliders (shown here) ",
- "- Flying dialog boxes (with alert boxes) ",
- "- Color icon fixes and display ",
- "- Complete Extended Object Type fix, ",
- " with object types compatible with Inter-",
- " Face Resource Construction Set ",
- "- Drag-and-drop protocols ",
- "- Interprocess communication routines ",
- "- Custom desktop with iconifyable windows ",
- "- Programs can run as ACC or PRG ",
- "- Custom windows ",
- "- Dropdown, popup, and siderooted menus ",
- "- WinX, and Geneva compatibility ",
- "- Inquirable window closure ",
- "- Image scaling inside dialog boxes ",
- "- Customized window states, styles, and ",
- " actions ",
- "- Task-switching multitasking timers ",
- "- Text windows with Hypertext type lookup ",
- "- Standard and customized appl_getinfo ",
- " call standard to most MultiTOS apps ",
- "- Custom resource file loader (64K limit ",
- " is demolished) ",
- "- Cookie management (get, create, delete, ",
- " move, clear, get size) ",
- "- MultiTOS and Geneva name registration ",
- "- Modal/Non-modal dialog boxes ",
- "- Un-untoppable windows (as with this one)",
- "- Custom text editing (inside objects) ",
- "- Editing ASCII-Table ",
- "- Resource object intersection and inside ",
- " object management ",
- "- Alert boxes with color icons ",
- "- Desktop functions like XWindows GUIs ",
- "- Change 3D drawing types at will ",
- "- Smart hotkeys ",
- "- Internal title screen ",
- "- Custom desktop menubar handler that ",
- " supports sideroots of unlimited depths ",
- "- All resource files are WYSIWYG style ",
- " (What you see is what you get) ",
- "- 3D Menu bar fixes ",
- "- Cursor changes to I-Beam on editable ",
- " text object fields ",
- "- Customizable desktop ",
- " - Mouse can take form of mini-icon ",
- " defined by yourself, or using the ",
- " internal mouse forms ",
- " - Desktop background can display a ",
- " picture ",
- "- Window dominance settings (for the ",
- " un-untoppable windows) ",
- " ",
- "Current problems: ",
- "\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\" ",
- "- Many features are still quite buggy ",
- "- Desktop routines are in dire need of ",
- " being revamped ",
- "- Text routines for hypertext are being ",
- " redesigned... ",
- "- MultiTOS HATES our 3D routines, and our ",
- " custom menubar handler. Hopefully ",
- " Markus Gutschke will give us some in- ",
- " sight on fixes. ",
- "- DESPERATELY needs a setup program ",
- " ",
- "Still to come: ",
- "\"\"\"\"\"\"\"\"\"\"\"\"\"\" ",
- "- All bugs totally and completely fixed ",
- "- Underscore bug fix (numerical fields) ",
- "- Completely working desktop routines ",
- "- Clipboard support for object pasting ",
- " and saving object information ",
- "- Menus with scrollable menus ",
- "- Text Gadgets (by request) ",
- " ",
- "If you wish to see what bugs were fixed, ",
- "please consult \"BUGFIX.LOG\" for info. ",
- " ",
- "If you need to contact any of the authors ",
- "for any reason, please contact us at: ",
- " ",
- "Ken Hollis (khollis@bitsink.gbdata.com) ",
- "Karl 0ygard (karlo@ifi.uio.no) ",
- " ",
- "Since Karl 0ygard is away most of the time",
- "it would be wise to write to Ken Hollis. ",
- "Besides, he's the head programmer, and can",
- "probably answer all of your questions. ",
- " ",
- "We DARE you to find a faster, more ",
- "reliable OOP library that offers the same ",
- "features as WinLIB PRO, and has the same ",
- "functionality, 3D effects, and other ",
- "modifications available. Believe us when ",
- "we say WinLIB PRO is ONE-OF-A-KIND. ",
- " ",
- "-- End of text -- Enjoy the demo!" };
-
- #define tl 165
- #define tw 42
-
- void ShowText(WINDOW *win, int object, int amount)
- {
- int i, start, end, vgstarter, vx, vy, clip[4], boundy;
- int blit[8], sign, move;
- MFDB src, dest;
-
- XVDI_SaveHandles();
- vst_height(VDIhandle, 4, &i, &i, &i, &i);
-
- WGrafMouse(M_OFF);
-
- if (amount > 0)
- sign = 1;
- else
- sign = -1;
-
- move = abs(amount);
-
- objc_offset(win->tree, object, &vx, &vy);
- vgstarter = vy + gr_ch;
-
- clip[0] = vx + 2;
- clip[1] = vy;
- clip[2] = vx + 2 + win->tree[object].ob_width - 1;
- clip[3] = vy + win->tree[object].ob_height - 1;
- vs_clip(VDIhandle, 1, clip);
-
- boundy = vy + win->tree[object].ob_height;
-
- if (boundy < desk.g_y + desk.g_h) {
- if ((move != 0) && (move < showable)) {
- if (sign == 1) {
- /* src */ blit[0] = (vx + gr_cw);
- blit[1] = (vy + (move * gr_ch)) + 3;
- blit[2] = (vx + gr_cw) + (tw * gr_cw);
- blit[3] = (vy + (showable * gr_ch)) + 3;
-
- /* dest */ blit[4] = (vx + gr_cw);
- blit[5] = vy + 3;
- blit[6] = (vx + gr_cw) + (tw * gr_cw);
- blit[7] = (vy + (showable * gr_ch)) + 3;
- } else {
- /* src */ blit[0] = (vx + gr_cw);
- blit[1] = (vy + 3);
- blit[2] = (vx + gr_cw) + (tw * gr_cw);
- blit[3] = (vy + (showable * gr_ch)) - (move * gr_ch) + 3;
-
- /* dest */ blit[4] = (vx + gr_cw);
- blit[5] = (vy + (move * gr_ch)) + 3;
- blit[6] = (vx + gr_cw) + (tw * gr_cw);
- blit[7] = (vy + (showable * gr_ch)) + 3;
- }
-
- src.fd_addr = dest.fd_addr = NULL;
- vro_cpyfm(VDIhandle, 3, blit, &src, &dest);
- }
-
- if ((move) && (move < showable)) {
- if (sign == 1) {
- start = ((win->slidpos[1] + showable) - move) - 1;
- end = (win->slidpos[1] + showable);
- vgstarter = (vy + ((showable - move) * gr_ch));
- } else {
- start = win->slidpos[1];
- end = start + move;
- }
- } else {
- start = win->slidpos[1];
- end = ((start + showable) > tl) ? tl : (start + showable);
- }
-
- i = start;
-
- while((i!=end) && (i < tl)) {
- v_gtext(VDIhandle, (vx + gr_cw), vgstarter, texthelp[i]);
- vgstarter += gr_ch;
- i++;
- }
- } else {
- i = start = win->slidpos[1];
- end = ((start + showable) > tl) ? (tl - showable) : (start + showable);
-
- while((i!=end) && (i < tl)) {
- v_gtext(VDIhandle, (vx + gr_cw), vgstarter, texthelp[i]);
- vgstarter += gr_ch;
- i++;
- }
- }
-
- clip[0] = desk.g_x;
- clip[1] = desk.g_y;
- clip[2] = desk.g_w;
- clip[3] = desk.g_h;
- vs_clip(VDIhandle, 1, clip);
-
- XVDI_RestoreHandles();
-
- WGrafMouse(M_ON);
- }
-
- int Dlg6Dispatcher(WINDOW *win, int msg_buf[8])
- {
- switch (*msg_buf) {
- case WM_KILL:
- return FALSE;
-
- case WM_CREATED:
- showable = (win->tree[HTAREA].ob_height / gr_ch) - 1;
- VerticalSlideReset(win, 1, (tl - showable), 0, HTSLIDE, HTTRACK, 0, 0);
- return FALSE;
-
- case WM_PAINT:
- ShowText(win, HTAREA, 0);
- return FALSE;
-
- case WM_DIALOG:
- switch(msg_buf[3]) {
- case HT_UP:
- case HT_DOWN:
- case HTSLIDE:
- case HTTRACK:
- lastpos = win->slidpos[1];
-
- DoVerticalSlide(win, 1, HTTRACK, HTSLIDE,
- HT_UP, HT_DOWN, msg_buf[3],
- (showable - 2), 0);
-
- if (lastpos != win->slidpos[1])
- ShowText(win, HTAREA, (-(lastpos - win->slidpos[1])));
- return FALSE;
- }
- return FALSE;
- }
-
- return FALSE;
- }
-